package com.foreknow.controller;

import com.foreknow.po.Business;
import com.foreknow.service.BusinessService;
import com.foreknow.service.Impl.BusinessServiceImpl;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public class BusinessController {

    public Object listBusinessByOrderTypeId(HttpServletRequest request){
        BusinessService service = new BusinessServiceImpl();
        Integer orderTypeId = Integer.parseInt(request.getParameter("orderTypeId"));
        List<Business> list = service.listBusinessByOrderTypeId(orderTypeId);
        return list;
    }

    public Object getBusinessById(HttpServletRequest request){
        BusinessService service = new BusinessServiceImpl();
        Integer businessId =  Integer.parseInt(request.getParameter("businessId"));
        Business business = service.getBusinessById(businessId);
        return business;
    }



}
